<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>注册</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"
	media="screen">
<link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"
	media="screen">
<link href="assets/styles.css" rel="stylesheet" media="screen">
<script src="vendors/modernizr-2.6.2-respond-1.1.0.min.js"></script>

  <script type="text/javascript">
		function onSelectChanged(){
			var arrays=[
			    [],
				["南京","徐州","无锡"],
				["济宁","青岛","东营"],
				["长沙","怀化","泸州"],
				["沈阳","大连","凌源"]
			];
			var indexer=0;
			var level1=document.getElementById('province');
			var level1_options=level1.children;
			for (var i = level1_options.length - 1; i >= 0; i--) {
				var option=level1_options[i];
				if (option.selected) {
					var id=option.id;
					indexer=id; 
					break;
				}
			}
			var level2=arrays[indexer];
			var html= "";
			for (var i = level2.length - 1; i >= 0; i--) {
				var values=level2[i];
				var option_html="<option>"+values+"</option>";
				html=html+option_html;

			}
			var level2_select=document.getElementById('city');
			level2_select.innerHTML=html;

		}
		
		function validate_required(field,alerttxt)
		{
		with (field)
		{
		if (value==null||value=="")
		  {alert(alerttxt);return false}
		else {return true}
		}
		}
		
		
	</script>
</head>

<body>
	<div class="row-fluid">
		
		<!-- block -->
		<div class="block">
			<div class="navbar navbar-inner block-header">
				<div class="muted pull-left">用户信息</div>
			</div>
			<div class="block-content collapse in">
				<div class="span12">
					<form class="form-horizontal" action="addUser" onsubmit="return validate_form(this)"
						method="post">
						<fieldset>
							<legend>增加用户信息</legend>
							<div class="control-group">
								<label class="control-label" for="focusedInput" id="nameTip">用户名:</label>
								<div class="controls">
									<input class="input-xlarge focused" id="username"
										
										type="text" name="username"
										style="width:100px;">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="focusedInput" id="id="passwordTip"">密码:</label>
								<div class="controls">
									<input class="input-xlarge focused" id="password"
										type="text" name="password"
										style="width:100px;">
									<span id="nameTip"></span>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="focusedInput">真实姓名:</label>
								<div class="controls">
									<input class="input-xlarge focused" id="focusedInput"
										type="text" name="realname"
										style="width:100px;">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="focusedInput">性别:</label>
								<div class="controls">
									男<input name="sex" type="radio" value="男" selected="selected"/>
						           	女<input type="radio" name="sex" value="女" />
						              
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="focusedInput">省份:</label>
								<div class="controls">
									    <select id="province" name="province"  onchange="onSelectChanged()" style="width:100px;" >
									    <option id="1" value="江苏">江苏</option>
									    <option id="2" value="山东">山东</option>
									    <option id="3" value="湖南">湖南</option>
									    <option id="4" value="辽宁">辽宁</option>
									    </select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="focusedInput">市县:</label>
								<div class="controls">
    								<select id="city" name="city"  style="width:100px;"></select>

								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="focusedInput">证件类型:</label>
								<div class="controls">
									<select class="input-xlarge focused" id="focusedInput" name="certType" style="width:100px;">
						                <option >二代身份证</option>
						                <option >港澳通行证</option>
						                <option >台湾通行证</option>
						                <option >护照</option>
						            </select> 
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="focusedInput">证件号码:</label>
								<div class="controls">
									<input class="input-xlarge focused" id="focusedInput"
										type="text" name="cert"
										style="width:100px;">
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label" for="focusedInput">用户类型:</label>
								<div class="controls">
									
									<select class="input-xlarge focused" id="focusedInput"  name="userType" style="width:100px;">
							                <option >成人</option>
							                <option >儿童</option>
							                <option >学生</option>
							                <option >残疾军人、伤残人民警察</option>
							            </select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="focusedInput">备注:</label>
								<div class="controls">
									<input class="input-xlarge focused" id="focusedInput"
										type="text" name="content"
										value="安全第一"
										style="width:100px;">
								</div>
							</div>
							<div class="form-actions">
								<button type="submit" class="btn btn-primary">确定</button>
								<button type="reset" class="btn">重置</button>
							</div>
						</fieldset>
					</form>
				</div>
			</div>
		</div>
		<!-- /block -->
	</div>

	<script src="vendors/jquery-1.9.1.js"></script>
	<script src="bootstrap/js/bootstrap.min.js"></script>
	<script src="vendors/jquery.uniform.min.js"></script>
	<script src="vendors/chosen.jquery.min.js"></script>
	<script src="vendors/bootstrap-datepicker.js"></script>

	<script src="vendors/wysiwyg/wysihtml5-0.3.0.js"></script>
	<script src="vendors/wysiwyg/bootstrap-wysihtml5.js"></script>

	<script src="vendors/wizard/jquery.bootstrap.wizard.min.js"></script>

	<script type="text/javascript"
		src="vendors/jquery-validation/dist/jquery.validate.min.js"></script>
	<script src="assets/form-validation.js"></script>

	<script src="assets/scripts.js"></script>
	
</body>
</html>
	